﻿<%@ Page Language="C#" AutoEventWireup="true"  enableEventValidation="false" CodeBehind="addrbook_group_set.aspx.cs" Inherits="Ccit.OA.AddrBook.addrbook_group_set" %>
<%@ Register TagPrefix="ccit" Namespace="Ccit.ServerControls" Assembly="Ccit.ServerControls.ActionForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>个人通讯录-分组设置</title>
     <script language="javascript" type="text/javascript" src="../script/jquery.js"></script>
        <script language="javascript" type="text/javascript" src="../script/StringClass_Ext.js"></script>
        <script language="javascript" type="text/javascript" src="../script/jsonlib.js"></script>
        <script language="javascript" src="../script/jwindow.js" type="text/javascript"></script>
        <script language="javascript" src="../script/jcontrol.js" type="text/javascript"></script>
        <script language="javascript" src="../script/jbase64.js" type="text/javascript"></script>
        <script type="text/javascript">
            function doAdd()
            {
                var vGroupName = document.getElementById("txtGroupName").value;
                if(vGroupName.Trim()!="")
                {
                    var msAddBookDetail = {}; //消息对象
                    msAddBookDetail.ID = document.getElementById("_hidTypeID").value;
                    msAddBookDetail.GroupName = vGroupName;
                      var jsonExpr = JSON.stringify(msAddBookDetail,function(key,value){return value;}); 
                      msAddBookDetail = null; 
                     PageMethods.DoSaveMes(jsonExpr,ClientCallBack);    
                }
                else
                {
                    alert("分组名称不能为空!");
                }
            }
            function ClientCallBack(vResult)
            {
                if(vResult !="-999")
                { 
                        alert("操作成功!");
                        document.getElementById("_hidTypeID").value ="";
                        document.getElementById("txtGroupName").value="";
                        if(vResult=="1")
                            __doPostBack("lnbQuery","");
                      return true;
                } 
                else
                {
                        alert("服务器忙,请稍候再试!");
                        return false;
                }
            }
            function doRemoveRows(vTableName,vsRecid,vRowId)  
            {             
                var oType="4";
                var otable = document.getElementById(vTableName);
		        var oRowIndex = document.getElementById(vRowId).rowIndex;		        	        
		        if (confirm("删除当前行,是否继续?"))
		        {
		            PageMethods.DoOperate(vsRecid,ClientCallBack); 
		            otable.deleteRow(oRowIndex);
		        }
            }
            function doEdIt(vSId,vRowIndex)
            {
                var otable=document.getElementById("tbProduct");
                var orowcount=otable.rows.length;
                var orow;  
                orow=otable.rows[vRowIndex]; 
                var GroupNam=orow.cells(0).innerText;
                document.getElementById("_hidTypeID").value = vSId;
                document.getElementById("txtGroupName").value = GroupNam;
        }
        </script>
</head>
<body>
    <ccit:ActionForm id="form1" runat="server">
     <asp:LinkButton ID="lnbQuery" CssClass="linktext" runat="server" 
                                 Visible="false" onclick="lnbQuery_Click" ></asp:LinkButton>
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
    </asp:ScriptManager> 
    <input type="hidden" id="_hidTypeID" runat="server" />
        <table class="tbToolbar" cellpadding="0" cellspacing="0" width="98%" align="center">
            <tr>
            <td width="2%" align="left">
                <div class="tbSeparator">
                </div>
            </td>
            <td class="titlebar" width="38%">                   
                 个人通讯录-分组设置
            </td>
            <td align="right">               				 
					<nobr></nobr>            
            </td>
            <td align="right">
                <nobr>
            </td>            
          </tr>
         </table>
         <table class="tableborder" cellpadding="0" cellspacing="0" width="98%" align="center">
            <tr>
            <td align="right" width="10%" class="pformleft">分组</td>
            <td width="65%" class="pformrightline">
                <asp:TextBox  ID="txtGroupName" Runat="server" CssClass="input" Width="98%"></asp:TextBox>
            </td>
            <td class="pformright">
                <a  id="lnbAdd" Runat="server" class="linktext"  
                                href="javascript:doAdd()">
							        <img src="../images/toolbar/save.gif" border="0">保存
		        </a>
            </td>
            </tr>
         </table>
         <table   cellpadding="0" cellspacing="0" border="0" style="width:98%" align="center">
            <tr id ="row_0" class="listtitle">
                <td width="30%" align="center" class="listcelltitle"> 分组名称</td>
                <td width="10%" align="center" class="listcelltitle"> 操作</td>                
            </tr>                          
         </table>
         <table class="tableborder" cellpadding="0" cellspacing="0"  border ="0" width="98%" align="center" id="tbProduct" runat=server> 
         </table> 
    </ccit:ActionForm>
</body>
</html>
